const express = require('express');

const app = express();

app.all('/cors-server',(request,response)=>{
    // 设置响应头
    response.setHeader('Access-Control-Allow-Origin','*');
    response.setHeader('Access-Control-Allow-Headers','*');
    response.setHeader('Access-Control-Allow-Method','*');
    
    response.send('hello cros');
})

app.listen(8000,()=>{
    console.log('服务器已启动');
});